<?php
namespace app\admin\controller;

use think\Controller;
use think\Db;
class index extends Aclcommon
{
    public function index(){
     	return $this->fetch();
    }
    public function info(){
    	$mysql=Db::query('select VERSION() as version');
	    $list  = [
		                'THINKPHP版本'=>THINK_VERSION,
						'服务器软件'     => strpos($_SERVER['SERVER_SOFTWARE'], 'PHP')===false ? $_SERVER['SERVER_SOFTWARE'].'PHP/'.phpversion() : $_SERVER['SERVER_SOFTWARE'],
						'MYSQL版本'=>$mysql[0]['version']?$mysql[0]['version']:'unknown',
						'上传附件限制' => @ini_get('file_uploads') ? ini_get('upload_max_filesize') :'unknown',
						'执行时间限制' => ini_get('max_execution_time').'秒',
						'磁盘剩余空间 '=> round((@disk_free_space(".")/(1024*1024)),2).'M',
					    ];
	    $this->assign('list',$list);
    	return $this->fetch();
    }
    public function ll(){
        config([
            'han'=>'3',
            'chang'=>'4'
        ]);
        $re = Db::name("user")->select();
        dump($re);
    }
   public function fun(){
       print("我设置的一个字符串");
   }
   public function portrait(){
        $user_res = db('user')->find(session('uid'));
        dump($user_res);
        // $this->display();
   }
   public function hcred(){
        $client = new \Predis\Client();
        $client->set('foo','bar');
        $keys = $client->keys('*');
        $value = $client->get('foo');
        $arr = array($value,$keys);
        var_dump($arr);
   }
}